package a05_AbstractClass;

/**
 * @Author quan
 * @Description 父类:抽象类（因为有一个吃的抽象方法）
 * @Date 2023/1/28 21:40
 */
//抽象类
public abstract class Animal {
    private String name;
    private int age;

    public Animal() {
    }

    public Animal(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void drink(){
        System.out.println("动物在喝水");
    }

    public abstract void eat();//定义抽象方法

}
